package cn.itsource.pethome.org.domain;

import cn.itsource.pethome.base.domain.BaseDomain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "t_shop")
public class Shop implements BaseDomain {
    @Id
    // @GeneratedValue 返回主键,JDBC ,就是默认使用主键自增长
    @GeneratedValue(generator = "JDBC")
    private  Long id;
    @NotNull(message = "店铺名称不为空")
    private  String name;
    @Pattern(regexp="[0-9-()（）]{7,18}",message = "手机号格式不正确")
    private  String tel;
    //注册时间
    private  String registerTime;
    //注册状态
    private  Integer state;
    @NotNull(message = "店铺的注册地址不能为空")
    private  String address;
    private  String logo;
    private Boolean del;

    public String getLogoStr(){
        return "http://47.95.117.210:8888/"+this.logo;
    }

}
